package androidServlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.*;

import sessionMenegment.SessionMgr;

import controller.Controller;

@SuppressWarnings("serial")
public class LogInAndroid extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		
		String userName = req.getParameter("username");
		String password = req.getParameter("password");
		
		PrintWriter out = resp.getWriter();
		
		int logInStatus = Controller.getInstance().ClientlogIn(userName, password);
		
		if (logInStatus==0)
			out.println("true");
		else
			out.println("false");
			
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

	}
	
}
